﻿using FreeSql.DataAnnotations;
using Jumei.Common.BaseModel;
using System;

namespace Jumei.Model.Business.OrdersManage
{
    /// <summary>
    /// 订单结算表
    /// </summary>
    [Table(Name = "or_settlements")]
    [Index("idx_{tablename}_01", nameof(SettlementNo), false)]
    public class SettlementsEntity : EntityFull, ITenant
    {
        /// <summary>
        /// 租户Id
        /// </summary>
        [Column(Position = -10)]
        public long? TenantId { get; set; }

        /// <summary>
        /// 结算单号
        /// </summary>
        [Column(StringLength = 20)]
        public string SettlementNo { get; set; }

        /// <summary>
        /// 结算类型
        /// 0：手工结算
        /// </summary>
        [Column(StringLength = 20)]
        public int SettlementType { get; set; }

        /// <summary>
        /// 店铺ID
        /// </summary>
        public long ShopId { get; set; }

        /// <summary>
        /// 商品总金额
        /// </summary>
        public decimal SettlementMoney { get; set; }

        /// <summary>
        /// 结算应收的佣金（不含运费）
        /// </summary>       
        public decimal CommissionFee { get; set; }

        /// <summary>
        /// 应返还给商家的金额
        /// </summary>       
        public decimal BackMoney { get; set; }

        /// <summary>
        /// 结算状态
        /// 0:申请结算 
        /// 1:已结算
        /// </summary>       
        public int SettlementStatus { get; set; }

        /// <summary>
        /// 结算处理时间
        /// </summary>       
        public DateTime? SettlementTime { get; set; }

        /// <summary>
        /// 结算备注（商城填写）
        /// </summary>       
        [Column(StringLength = 255)]
        public DateTime? Remarks { get; set; }
    }
}
